#ifndef _MONITOR_H
#define _MONITOR_H

#include "common_h.h"

#if MON_DEBUG > 0
#define   mon_debug         lite_printf
#else 
#define   mon_debug(fmt,...) 	;
#endif

#define SECMON_BASE	0x40004000

/* Define register offset */
#define SECMON_EXTSC_OFST		0x00000000
#define SECMON_INTSC_OFST		0x00000004
#define SECMON_SECALM_OFST		0x00000008
#define SECMON_SECDIAG_OFST		0x0000000C
#define SECMON_DLRTC_OFST		0x00000010

/* Define register address */
#define SECMON_EXTSC		(SECMON_BASE + SECMON_EXTSC_OFST)
#define SECMON_INTSC		(SECMON_BASE + SECMON_INTSC_OFST)
#define SECMON_SECALM		(SECMON_BASE + SECMON_SECALM_OFST)
#define SECMON_SECDIAG		(SECMON_BASE + SECMON_SECDIAG_OFST)
#define SECMON_DLRTC		(SECMON_BASE + SECMON_DLRTC_OFST)

/* Bits Fields */
#define ENABLE_ALL_EXTS	 	0x1F
#define LOCK_REG	 		0x80000000
#define ENABLE_ALL_INTS		0x00000007
#define MINUS_50			0x10000
#define PLUS_110			0x20000

#define DRS_ALARM_FLAGS_MASK 0x00003FFC

void NMI_Handler(void);
u8 monitor_init(void);
u8 monitor_check(void);

#endif

